# Declaration of variables
CC = g++
CC_FLAGS = -Wall -g -c --std=c++98

# File names
EXEC = common.a
SOURCES = $(wildcard *.cpp)
OBJECTS = $(SOURCES:.cpp=.o)

# Main target
$(EXEC): $(OBJECTS)
	ar rvs $(EXEC) $(OBJECTS)

# To obtain object files
%.o: %.cpp 
	$(CC) $(CC_FLAGS) $< -o $@

# To remove generated files
clean:
	rm -f $(EXEC) $(OBJECTS)

all: $(EXEC)

.PHONY: all